---
title: BoundObjectFrame.ControlSource Property (Access)
keywords: vbaac10.chm10910
f1_keywords:
- vbaac10.chm10910
ms.prod: access
api_name:
- Access.BoundObjectFrame.ControlSource
ms.assetid: f4200d00-fcb8-f15b-68e5-f1e58bfe41e8
ms.date: 06/08/2017
---


# BoundObjectFrame.ControlSource Property (Access)

You can use the  **ControlSource** property to specify what data appears in a control. You can display and edit data bound to a field in a table, query, or SQL statement. You can also display the result of an expression. Read/write **String**.


## Syntax

 _expression_. **ControlSource**

 _expression_ A variable that represents a **BoundObjectFrame** object.


## Remarks

The  **ControlSource** property uses the following settings.



|**Setting**|**Description**|
|:-----|:-----|
|A field name|The control is bound to a field in a table, query, or SQL statement. Data from the field is displayed in the control. Changes to the data inside the control change the corresponding data in the field. (To make the control read-only, set the  **Locked** property to Yes.) If you click a control bound to a field that has a Hyperlink data type, you jump to the destination specified in the hyperlink address.|
|An expression|The control displays data generated by an expression. This data can be changed by the user but isn't saved in the database.|
For reports, the  **ControlSource** property applies only to report group levels.

Forms and reports act as "windows" into your database. You specify the primary source of data for a form or report by setting its  **RecordSource** property to a table, query, or SQL statement. You can then set the **ControlSource** property to a field in the source of data or to an expression. If the **ControlSource** property setting is an expression, the value displayed is read-only and not saved in the database. For example, you can use the following settings.



|**Sample setting**|**Description**|
|:-----|:-----|
|LastName|For a control, data from the LastName field is displayed in the control. For a report group level, Microsoft Access groups the data on last name.|
| `=Date( ) + 7`|For a control, this expression displays a date seven days from today in the control.|
| `=DatePart("q",ShippedDate)`|For a control, this expression displays the quarter of the shipped date. For a report group level, Microsoft Access groups the data on the quarter of the shipped date.|

## Example

The following example sets the  **ControlSource** property for a text box named AddressPart to a field named City:


```vb
Forms!Customers!AddressPart.ControlSource = "City"
```

The next example sets the  **ControlSource** property for a text box named Expected to the expression `=Date() + 7`




```vb
Me!Expected.ControlSource = "=Date() + 7"
```


## See also


#### Concepts


[BoundObjectFrame Object](boundobjectframe-object-access.md)

